<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('常用语列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="menu-form">
                <div class="select-list">
                    <ul>
                        <li>
                            类别编码：
                            <input type="text" name="codeBig"/>
                        </li>
                        <li>
                            类别名称：
                            <input type="text" name="type"/>
                        </li>
                        <li>
                            内容：
                            <input type="text" name="cstext"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索
                            </a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置
                            </a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()">
                <i class="fa fa-plus"></i>
                新增
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()">
                <i class="fa fa-edit"></i>
                修改
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>

<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "system/content";

    $(function () {
        var options = {
            uniqueId: "id",
            url: prefix + "/scodeSmallListJson",
            createUrl: prefix + "/addScodeSmall",
            updateUrl: prefix + "/editScodeSmall/{id}",
            removeUrl: prefix + "/removeScodeSmall",
            modalName: "常用语",
            sortName: "csord",
            sortOrder: "asc",
            fixedColumns: true,
            fixedRightNumber: 2,
            columns: [{
                checkbox: true
            },
                {field:'id',title:'id',align:'center',visible:false},
                {field:'codeBig',title:'类别编码',align:'center',sortable:true,halign:'center'},
                {field:'type',title:'类别名称',align:'center',halign:'center'},
                {field:'csvalue',title:'编号',align:'center',halign:'center'},
                {field:'cstext',title:'标题',align:'center',halign:'center',formatter:function (value){
                        return "<span style='cursor: pointer;' title='"+value+"'>"+value+"</span>"
                    },
                    cellStyle: cellEllipsis
                },
                {field:'remark',title:'内容',align:'center',halign:'center',formatter:function (value){
                        return "<span style='cursor: pointer;' title='"+value+"'>"+value+"</span>"
                    },
                    cellStyle: cellEllipsis
                },
                {field:'csord',title:'排序值',align:'center',halign:'center'},
                {
                    title: '操作',
                    width: '20',
                    widthUnit: '%',
                    align: "left",
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id+ '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>